home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n02.arc / STACK.BAT < prev    next >
DOS Batch File  |  1991-01-10  |  550b  |  26 lines

  1. @ECHO OFF
  2. REM The environment variable stack_arg holds the subcommand
  3. SET stack_arg=
  4.  
  5. :loop
  6. REM If we reached a delimiter, execute the subcommand
  7. IF '%1'=='!' GOTO execute
  8.  
  9. REM Keep building the subcommand
  10. SET stack_arg=%stack_arg% %1
  11. GOTO shift
  12.  
  13. :execute
  14. REM Call the subcommand we've built
  15. CALL %stack_arg%
  16. REM Clear for the next subcommand
  17. SET stack_arg=
  18.  
  19. :shift
  20. SHIFT
  21. REM If there are more commands, loop through again
  22. IF NOT '%1'=='' GOTO :loop
  23. REM Otherwise execute the last subcommand
  24. CALL %stack_arg%
  25. SET stack_arg=
  26.